package yf.mall.dao;

import com.yf.dao.BaseDao;
import yf.mall.entity.MallGoodsEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 产品Dao
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Mon Aug 05 11:30:53 CST 2019
 */
@Mapper
public interface MallGoodsDao extends BaseDao<MallGoodsEntity> {

    /**api**/

    /**
     * back
     **/
    void increaseStock(@Param("goodsId") Long goodsId, @Param("quantity") Integer quantity);

    void decreaseStock(@Param("goodsId") Long goodsId, @Param("quantity") Integer quantity);

    void increaseSkuStock(@Param("goodsId") Long goodsId, @Param("skuName") String skuName, @Param("quantity") Integer quantity);

    void decreaseSkuStock(@Param("goodsId") Long goodsId, @Param("skuName") String skuName, @Param("quantity") Integer quantity);

    List<MallGoodsEntity> findBySaleType(Map<String,Object> map);

    List<MallGoodsEntity> queryMallGoods(Map<String,Object> map);

    List<MallGoodsEntity> searchName(@Param("name") String name,@Param("shelf") int shelf);

    List<MallGoodsEntity> findGoods(int shelf);


}
